﻿IF object_id(N'dbo.UDS_WorkAttendence_SettingSearchOrder', 'U') IS NULL
BEGIN
    CREATE TABLE [dbo].[UDS_WorkAttendence_SettingSearchOrder] (
        [ID]   int           NOT NULL,
        [Name] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,

        CONSTRAINT [PK_UDS_WorkAttendence_SettingSearchOrder] PRIMARY KEY CLUSTERED ([ID] asc),
        CONSTRAINT [CK_UDS_WorkAttendence_SettingSearchOrder_ID] CHECK ( [ID]>0 )
    );
END
GO

SET NOCOUNT ON;
IF NOT EXISTS (SELECT 1 FROM dbo.UDS_WorkAttendence_SettingSearchOrder)
BEGIN
    INSERT INTO dbo.UDS_WorkAttendence_SettingSearchOrder ([ID], [Name]) VALUES ( 1, N'Staff' );
    INSERT INTO dbo.UDS_WorkAttendence_SettingSearchOrder ([ID], [Name]) VALUES ( 2, N'Position' );
    INSERT INTO dbo.UDS_WorkAttendence_SettingSearchOrder ([ID], [Name]) VALUES ( 3, N'Company' );
END
GO